﻿using CfgTable;
using IQIGame.Onigao.Framework;

namespace IQIGame.Onigao.GamePlay
{
    /// <summary>
    /// 类名 : 界面单元数据 - 英雄特性
    /// 作者 : Canyon / 龚阳辉
    /// 日期 : 2024-05-27 14:32
    /// 修改 : 2024-06-06 16:34
    /// 功能 : 
    /// </summary>
    public class UD_HereFeature : IReusableClass
    {
        public int nCurrBigStar { get; private set; } = -2;
        public int starCid { get; private set; }
        public int nBigStarInCfg { get; private set; } = -1;
        public UD_HereFeature() { }

        public UD_HereFeature Sync(int heroBigStar, int starCid)
        {
            this.nCurrBigStar = heroBigStar;
            this.starCid = starCid;
            this.nBigStarInCfg = this.cfgStar.BigStar;
            return this;
        }

        public void Clear()
        {
            this.starCid = 0;
            this.nCurrBigStar = -2;
            this.nBigStarInCfg = -1;
        }

        public CfgHeroStar cfgStar => TableCenter.heroStar.Get(starCid);
        public bool isUnlock => this.nCurrBigStar >= this.nBigStarInCfg;

        #region 对象池
        public uint MaxStore => 5;

        public void OnReset()
        {
            this.Clear();
        }

        public void Put2Pool()
        {
            ClassPool.Put(this);
        }

        static public UD_HereFeature NewFromPool()
        {
            return ClassPool.Get<UD_HereFeature>();
        }
        #endregion

    }
}
